﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;


namespace MQ.Core.Entity.System
{
    public class CompanyMap : IEntityTypeConfiguration<CompanyEntity>
    {
        public void Configure(EntityTypeBuilder<CompanyEntity> builder)
        {
            builder.HasKey(m => m.Id);
        }
    }
    [Table("Sys_Company")]
    public class CompanyEntity
    {
        [Column("ID")]
        public long Id { set; get; }
        [Column("PARENTID")]
        public long ParentId { set; get; }
        [Column("NAME")]
        public string Name { set; get; }
        [Column("PROVINCE")]
        public string Province { set; get; }
        [Column("CITY")]
        public string City { set; get; }
        [Column("DISTRICT")]
        public string District { set; get; }
        [Column("ADDRESS")]
        public string Address { set; get; }
        /// <summary>
        /// 状态：0-无效、1-有效
        /// </summary>
        [Column("STATUS")]
        public int? Status { set; get; }
        [Column("DESCRIPTION")]
        public string Description { set; get; }
        [Column("SEQ")]
        public int? Seq { set; get; }

        [NotMapped]
        public string ProvinceName { set; get; }
        [NotMapped]
        public string CityName { set; get; }
        [NotMapped]
        public string DistrictName { set; get; }
    }
}
